package week4;

public class Sort {
    public static void main(String[] args) {
        int[] age = {18, 19, 20, 19, 35, 24, 16};
        int s, r, n = age.length;
        System.out.println("排序前");
        for (int i = 0; i < age.length; i++) {
            System.out.println(age[i] + "");
        }
        System.out.println();
        for (int i = 0; i < n - 1; i++) {
            s = i;
            for (int j = 0; j < n; j++) {
                if (age[s] > age[j]) {

                }
            }
            r = age[s];
            age[s] = age[i];
            age[i] = r;
        }
        System.out.println("排序后");
        for (int i = 0; i < age.length; i++) {
            System.out.println(age[i] + "");
        }
        System.out.println();
    }
}
